<template>
  <view class="block" @click="lineClick(objData)">

    <view class="block-top">
      <!--路线图片-->
      <view class="block-top-left">
        <view class="block-top-lable">
          <text>{{ objData.lineType }}</text>
        </view>
        <image :src="objData.themeImg" mode="aspectFill"></image>
        <image src="https://hzdaoziji.oss-cn-hangzhou.aliyuncs.com/file2ed1455ea62b4de19fa602f80e9602bd.png">
        </image>
      </view>

      <!--路线地图-->
      <!-- <map class="block-top-right"></map> -->
    </view>

    <view class="block-center">
      <view class="block-center-title">{{ objData.name }}</view>
      <!-- 标签布局 -->
      <view class="LabelLayout">
        <!-- 标签 -->
        <view v-for="tag in  objData.tags" :key="tag" class="block-center-lable">
          <text>{{ tag }}</text>
        </view>
      </view>

      <view class="block-center-tips">
        <view class="block-center-desc">{{ objData.scenicCount }}个景点 ｜
          {{ objData.taskCount }}个任务 ｜ 全程{{ Math.ceil(objData.distance / 100) / 10 }}km
        </view>
        <view class="block-center-price">￥
          <view class="block-center-priceNum">{{ objData.lineFee }}</view>
          /人
        </view>
      </view>
    </view>

    <view class="block-bottom">
      <view class="block-bottom-left">
        <image :src="objData.headImg"></image>
        <text>{{ objData.userName }}</text>
      </view>
      <view class="block-bottom-right">
        <image :src="hotImage"></image>
        <text>{{ objData.hot }}</text>
      </view>
    </view>
  </view>
</template>

<script>
import {
  addHot
} from "@/api/challenge";

export default {
  props: {
    objData: {
      type: Object,
      default: {}
    }
  },
  data() {
    return {
      hotImage: 'https://echengtuhua.oss-cn-shenzhen.aliyuncs.com/%E8%B7%AF%E5%BE%84%20404.png'
    }
  },
  methods: {
    lineClick(data) {
      addHot({
        proposalId: data.id
      }).then(res => {
        // console.log('增加热度', res);
      })
      uni.navigateTo({
        url: '/pages/PopularRoute/RouteDetails?id=' + data.id
      });
    }
  },
}
</script>

<style src="./luxian.css">

</style>
